{% extends 'base/base.html' %}
{% load static %}
{% block title %}课堂列表{% endblock %}
{% block link %}
    <link rel="stylesheet" href="{% static 'css/myadmin/bootstrap.min.css' %}">
    <script>
        iMenuIndex = 1
    </script>
    <style>
    th {
        border: solid black 1px;
    }
    td {
        border: solid black 1px;
    }
    </style>
{% endblock %}
{% block header %}
<header id="header">
  <div class="mw1200 header-contain clearfix">
    <!-- logo start -->

    <!-- logo end -->
    <!-- nav start -->
    <nav class="nav">
      <ul class="menu">
        <li><a href="{% url "course:cate_list" %}">首页</a></li>
        <li><a href="{% url "course:index" %}">课件包</a></li>
      </ul>
    </nav>
    <!-- nav end -->
    <!-- login start -->
      <div class="login-box">
          {% if user.is_authenticated %}
              <div class="author">
                    <i class="PyWhich py-user"></i>
                    <span>{{ user.username }}</span>
                    <ul class="author-menu">
                        <li><a href="{% url 'myadmin:index' %}">后台管理</a></li>
                        <li><a href="{% url 'user:logout' %}">退出登录</a></li>
                    </ul>
                </div>
            {% else %}
                <div>
                    <i class="PyWhich py-user"></i>
                    <span>
                    <a href="{% url 'user:login' %}" class="login">登录</a> / <a href="{% url 'user:register' %}"
                                                                             class="reg">注册</a>
              </span>
                </div>
            {% endif %}
      </div>
    <!-- login end -->
  </div>
</header>

{% endblock header %}
{% block main_start %}

    <main id="course-container">
        <div class="w1200">
            <ul class="course-list">
                        <div style="height: 800px; " class="box-body">
            <table class="table table-bordered" style="width:100%;border: solid red 1px">
                <tbody style="border: solid red 1px">
                <tr>
                    <th><h3>课程类</h3></th>
                    <th><h3>课程</h3></th>
{#                    <th>url</th>#}
{#                    <th>图标</th>#}
{#                    <th>权限码</th>#}
{#                    <th>顺序</th>#}
{#                    <th>是否可见</th>#}
{#                    <th>逻辑删除</th>#}
{#                    <th>操作</th>#}
                </tr>
                {% for menu in categorys %}
                    <tr>
                        <td style="font-weight: bold">{{ menu.name }}</td>
                        <td></td>
{#                        <td>{{ menu.url|default:'' }}</td>#}
{#                        <td>{{ menu.icon }}</td>#}
{#                        <td>{{ menu.codename }}</td>#}
{#                        <td>{{ menu.order }}</td>#}
{#                        <td>{% if menu.is_visible %}是{% else %}否{% endif %}</td>#}
{#                        <td>{% if menu.is_delete %}是{% else %}否{% endif %}</td>#}
{#                        <td style="width: 100px" data-id="{{ menu.id }}" data-name="{{ menu.name }}">#}
{#                            <button type="button" class="btn btn-info btn-xs edit">编辑</button>#}
{#                            {% if not menu.children.all %}#}
{#                                <button type="button" class="btn btn-danger btn-xs delete">删除</button>{% endif %}#}
{#                        </td>#}
                        {% if menu.children.all %}
                            {% for child in menu.children.all %}
                                <tr>
                                    <td></td>
                                    <td>{{ child.name }}</td>
{#                                    <td>{{ child.url }}</td>#}
{#                                    <td>{{ child.icon }}</td>#}
{#                                    <td>{{ child.codename }}</td>#}
{#                                    <td>{{ child.order }}</td>#}
{#                                    <td style="width: 80px">{% if child.is_visible %}是{% else %}否{% endif %}</td>#}
{#                                    <td style="width: 80px">{% if child.is_delete %}是{% else %}否{% endif %}</td>#}
{#                                    <td style="width: 100px" data-id="{{ child.id }}" data-name="{{ child.name }}">#}
{#                                        <button type="button" class="btn btn-info btn-xs edit">编辑</button>#}
{#                                        <button type="button" class="btn btn-danger btn-xs delete">删除</button>#}
{#                                    </td>#}
                                </tr>
                            {% endfor %}
                        {% endif %}
                    </tr>
                {% endfor %}
                </tbody>
            </table>
                        <h1 style="color: red">请联系管理员开通权限</h1>
        </div>

            </ul>
        </div>
    </main>
{% endblock %}